﻿var kendofiles = [
    "/scripts/assets/global/plugins/kendoui/kendo.common.min.css",
    "/scripts/assets/global/plugins/kendoui/kendo.Office365.min.css",
    "/scripts/assets/global/plugins/kendoui/kendo.web.min.js",
    "/scripts/assets/global/plugins/kendoui/cultures/kendo.messages.zh-CN.min.js",
    "/scripts/assets/global/plugins/kendoui/cultures/kendo.culture.zh-CN.min.js"
];
osharpApp.config(["$stateProvider", "$urlRouterProvider", function ($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise("/shipments");
    $stateProvider
        .state("dashboard", {
            url: "/dashboard",
            templateUrl: "/app/admin/dashboard/dashboard.html",
            data: { pageTitle: "信息汇总" },
            controller: "app.admin.dashboard",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: [
                                "/scripts/assets/global/plugins/morris/morris.css",
                                "/scripts/assets/global/plugins/morris/morris.min.js",
                                "/scripts/assets/global/plugins/morris/raphael-min.js",
                                "/scripts/assets/global/plugins/jquery.sparkline.min.js",
                                "/scripts/assets/pages/scripts/dashboard.min.js",
                                "/app/admin/dashboard/dashboard.js"
                            ]
                        });
                    }
                ]
            }
        }).state("users", {
            url: "/users",
            templateUrl: "/app/admin/identity/users.html",
            data: { pageTitle: "用户信息管理" },
            controller: "app.admin.identity.users",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: kendofiles.concat([
                                "/app/admin/identity/users.js"
                            ])
                        });
                    }
                ]
            }
        }).state("roles", {
            url: "/roles",
            templateUrl: "/app/admin/identity/roles.html",
            data: { pageTitle: "角色信息管理" },
            controller: "app.admin.identity.roles",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: kendofiles.concat([
                                "/app/admin/identity/roles.js"
                            ])
                        });
                    }
                ]
            }
        }).state("customers", {
            url: "/customers",
            templateUrl: "/app/admin/store/customers.html",
            data: { pageTitle: "客户信息管理" },
            controller: "app.admin.store.customers",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: kendofiles.concat([
                                "/app/admin/store/customers.js"
                            ])
                        });
                    }
                ]
            }
        }).state("products", {
            url: "/products",
            templateUrl: "/app/admin/store/products.html",
            data: { pageTitle: "商品信息管理" },
            controller: "app.admin.store.products",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: kendofiles.concat([
                                "/app/admin/store/products.js"
                            ])
                        });
                    }
                ]
            }
        }).state("stockinglogs", {
            url: "/stockinglogs",
            templateUrl: "/app/admin/store/stockinglogs.html",
            data: { pageTitle: "入库记录信息管理" },
            controller: "app.admin.store.stockinglogs",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: kendofiles.concat([
                                "/app/admin/store/stockinglogs.js"
                            ])
                        });
                    }
                ]
            }
        }).state("shipments", {
            url: "/shipments",
            templateUrl: "/app/admin/store/shipments.html",
            data: { pageTitle: "出货记录信息管理" },
            controller: "app.admin.store.shipments",
            resolve: {
                deps: [
                    "$ocLazyLoad",
                    function($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: "OSharpApp",
                            serie: true,
                            insertBefore: "#ng_load_plugins_before",
                            files: kendofiles.concat([
                                "/app/admin/store/shipments.js"
                            ])
                        });
                    }
                ]
            }
        });
}]);